<!doctype html public "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>
<head>
<meta name="robot" content="index,follow">
<title>Module nni - n-Tree base Iterator - Forth Foundation Library</title>
</head>
<body>
<h2>nni - n-Tree base Iterator</h2>
<h3>Module Description</h3>
<p>The nni module implements an iterator on the base n-Tree [nnt].
</p>
<h3>Module Words</h3>
<dl>
</dl>
<h4>Iterator structure</h4>
<dl>
<dt><a name="word1"><b>nni%</b>	( -- n )</dt>
<dd>Get the required space for a nni variable</dd>
</dl>
<h4>Iterator creation, initialisation and destruction</h4>
<dl>
<dt><a name="word2"><b>nni-init</b>	( nnt nni -- )</dt>
<dd>Initialise the iterator with the n-tree nnt</dd>
<dt><a name="word3"><b>nni-create</b>	( nnt "&lt;spaces&gt;name" -- ; -- nni )</dt>
<dd>Create a named iterator in the dictionary on the n-tree nnt</dd>
<dt><a name="word4"><b>nni-new</b>	( nnt -- nni )</dt>
<dd>Create an iterator on the heap on the n-tree nnt</dd>
<dt><a name="word5"><b>nni-free</b>	( nni -- )</dt>
<dd>Free the iterator from the heap</dd>
</dl>
<h4>Member words</h4>
<dl>
<dt><a name="word6"><b>nni-get</b>	( nni -- nnn | nil )</dt>
<dd>Get the current node</dd>
</dl>
<h4>Tree iterator words</h4>
<dl>
<dt><a name="word7"><b>nni-root?</b>	( nni -- flag )</dt>
<dd>Check if the current node is the root node</dd>
<dt><a name="word8"><b>nni-root</b>	( nni -- nnn | nil )</dt>
<dd>Move the iterator to the root of the tree, return this node</dd>
<dt><a name="word9"><b>nni-parent</b>	( nni -- nnn | nil )</dt>
<dd>Move the iterator to the parent of the current node, return this node</dd>
<dt><a name="word10"><b>nni-children</b>	( nni -- n )</dt>
<dd>Return the number of children of the current node</dd>
<dt><a name="word11"><b>nni-children?</b>	( nni -- flag )</dt>
<dd>Check if the current node has children</dd>
<dt><a name="word12"><b>nni-child</b>	( nni -- nnn | nil )</dt>
<dd>Move the iterator to the first child of the current node, return this node</dd>
<dt><a name="word13"><b>nni-prepend-child</b>	( nnn nni -- )</dt>
<dd>Prepend a child to the children of the current node, iterator is moved to the new child</dd>
<dt><a name="word14"><b>nni-append-child</b>	( nnn nni -- )</dt>
<dd>Append a child to the children of the current node, iterator is moved to the new child</dd>
</dl>
<h4>Sibling iterator words</h4>
<dl>
<dt><a name="word15"><b>nni-first</b>	( nni -- nnn )</dt>
<dd>Move the iterator to the first sibling, return this node</dd>
<dt><a name="word16"><b>nni-next</b>	( nni -- nnn | nil )</dt>
<dd>Move the iterator to the next sibling, return this node</dd>
<dt><a name="word17"><b>nni-prev</b>	( nni -- nnn | nil )</dt>
<dd>Move the iterator to the previous sibling</dd>
<dt><a name="word18"><b>nni-last</b>	( nni -- nnn )</dt>
<dd>Move the iterator to the last sibling, return this node</dd>
<dt><a name="word19"><b>nni-first?</b>	( nni -- flag )</dt>
<dd>Check if the iterator is on the first sibling</dd>
<dt><a name="word20"><b>nni-last?</b>	( nni -- flag )</dt>
<dd>Check if the iterator is on the last sibling</dd>
<dt><a name="word21"><b>nni-insert-before</b>	( nnn nni -- )</dt>
<dd>Insert a sibling before the current sibling in the tree</dd>
<dt><a name="word22"><b>nni-insert-after</b>	( nnn nni -- )</dt>
<dd>Insert a sibling after the current sibling in the tree</dd>
<dt><a name="word23"><b>nni-remove</b>	( nni -- nnn )</dt>
<dd>Remove the current sibling without children from the tree, move the iterator to the next, previous or parent node, return the removed node</dd>
</dl>
<h4>Inspection</h4>
<dl>
<dt><a name="word24"><b>nni-dump</b>	( nni -- )</dt>
<dd>Dump the iterator</dd>
</dl>
<hr>
<div align="center">generated 24-Jul-2010 by <b>ofcfrth-0.10.0</b></div>
</body>
</html>
